package com.weishu.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.weishu.domain.Users;
import com.weishu.mapper.UsersMapper;
import com.weishu.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {
    @Autowired
    private UsersMapper sysUserMapper;

    @Override
    public PageInfo<Users> list(Users users) {
        PageHelper.startPage(users.getPageNum(),users.getPageSize());
        List<Users> list = sysUserMapper.list(users);
        System.out.println("============>>"+list);
        return new PageInfo<>(list);
    }

    @Override
    public boolean add(Users sysUser) {
        return sysUserMapper.add(sysUser);
    }

    @Override
    public boolean del(Integer userid) {
        return sysUserMapper.del(userid);
    }

    @Override
    public boolean update(Users sysUser) {
        return sysUserMapper.update(sysUser);
    }

    @Override
    public List<Users> getUser() {
        return sysUserMapper.getUser();
    }
}
